using UnityEngine;
using UnityEngine.UI;
public class PlayUI : MonoBehaviour
{
    public Image healthSlider; // 将UI血条拖拽到这个变量上
    [SerializeField] private float maxHealth=100; // 角色的最大生命值
    [SerializeField]private float currentHealth=100; // 角色的当前生命值
    public Player player;
    
    void Start()
    {
        maxHealth = player.stats.maxHealth;
    }

    void Update()
    {
        // currentHealth = player.stats.health;
        healthSlider.fillAmount = currentHealth / maxHealth; // 更新UI血条的
    }

}